<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui" template="/masterPage.xhtml">
	<ui:define name="content">
		<h:form id="books_list_form">
			<p:growl id="messages" showDetail="true" sticky="true" />

			<p:toolbar id="toolbar" style="margin-top:20px; margin-bottom:5px">
				<p:toolbarGroup align="left">
					<p:commandButton value="Create"
						action="#{booksBean.showCreateDialog}" style="font-size: 85% !important"/>

				</p:toolbarGroup>
			</p:toolbar>
			<p:dataTable id="BooksTable" var="book" value="#{booksBean.books}"
				rowKey="#{book.id}" selection="#{booksBean.selectedBook}"
				selectionMode="single">
				<p:column id="book_Name" headerText="Book Name"
					sortBy="#{book.name}">
					<h:outputText value="#{book.name}" />
				</p:column>
				<p:column id="book_Author" headerText="Author">
					<h:outputText value="#{book.authors.fullName}" />
				</p:column>
				<p:column id="book_Date" headerText="Published on">
					<h:outputText value="#{book.publishedOn}" />
				</p:column>
				<p:column id="book_isbn" headerText="ISBN">
					<h:outputText value="#{book.isbn}" />
				</p:column>
			</p:dataTable>

			</h:form>

			<h:form id="createdlg_form">
				<p:dialog id="createdlg" header="Create Dialog"
					widgetVar="createdlg" modal="true">
					<ui:include src="dialogs/newBookDialog.xhtml" />
				</p:dialog>
			</h:form>

	</ui:define>
</ui:composition>